package com.pzb.market.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pzb.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 优惠券对象 mk_coupon
 * 
 * @author pzb
 * @date 2021-10-11
 */
public class MkCoupon implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 编号 */
    private Long id;

    /** 商户id */
    private String extAppid;

    /** 优惠券名称 */
    private String couponName;

    /** 优惠券数量 */
    private Integer stock;

    /** 订单可使用金额 */
    private BigDecimal availableAmount;

    /** 优惠券使用单位   0 元，1为件 */
    private String unit;

    /** 优惠券类型   0为代金券，1为折扣券 */
    private String type;

    /** 减免金额或折扣率，95折用0.95表示 */
    private BigDecimal deductionAmount;

    /** 过期类型 0为领券后expirationDays天过期，1为指定日期区间 */
    private String expirationType;

    /** 过期天数 */
    private Integer expirationDays;

    /** 开始使用日期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date beginTime;

    /** 过期日期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    /** 优惠券状态，0为正常，1为停用 */
    private String status;

    /** 可使用商品  0为全部商品，1为指定分类，2为指定商品 */
    private String availableGoods;

    /** 用户领取状态 */
    private String state;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setExtAppid(String extAppid) 
    {
        this.extAppid = extAppid;
    }

    public String getExtAppid() 
    {
        return extAppid;
    }
    public void setCouponName(String couponName) 
    {
        this.couponName = couponName;
    }

    public String getCouponName() 
    {
        return couponName;
    }
    public void setStock(Integer stock) 
    {
        this.stock = stock;
    }

    public Integer getStock() 
    {
        return stock;
    }
    public void setAvailableAmount(BigDecimal availableAmount)
    {
        this.availableAmount = availableAmount;
    }

    public BigDecimal getAvailableAmount()
    {
        return availableAmount;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public String getType() 
    {
        return type;
    }
    public void setDeductionAmount(BigDecimal deductionAmount)
    {
        this.deductionAmount = deductionAmount;
    }

    public BigDecimal getDeductionAmount() 
    {
        return deductionAmount;
    }
    public void setExpirationType(String expirationType)
    {
        this.expirationType = expirationType;
    }

    public String getExpirationType()
    {
        return expirationType;
    }
    public void setExpirationDays(Integer expirationDays) 
    {
        this.expirationDays = expirationDays;
    }

    public Integer getExpirationDays() 
    {
        return expirationDays;
    }
    public void setBeginTime(Date beginTime) 
    {
        this.beginTime = beginTime;
    }

    public Date getBeginTime() 
    {
        return beginTime;
    }
    public void setEndTime(Date endTime) 
    {
        this.endTime = endTime;
    }

    public Date getEndTime() 
    {
        return endTime;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setAvailableGoods(String availableGoods) 
    {
        this.availableGoods = availableGoods;
    }

    public String getAvailableGoods() 
    {
        return availableGoods;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("extAppid", getExtAppid())
            .append("couponName", getCouponName())
            .append("stock", getStock())
            .append("availableAmount", getAvailableAmount())
            .append("type", getType())
            .append("deductionAmount", getDeductionAmount())
            .append("expirationType", getExpirationType())
            .append("expirationDays", getExpirationDays())
            .append("beginTime", getBeginTime())
            .append("endTime", getEndTime())
            .append("status", getStatus())
            .append("availableGoods", getAvailableGoods())
            .toString();
    }
}
